﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using WebReference;
using Session;
using PrimaryKeyFunction;


public partial class Usercontrols_Login : System.Web.UI.UserControl
{
    Service objService = new Service();

    protected void Page_Load(object sender, EventArgs e)
    {

    }

   
    protected void btnSubmit_Click(object sender, ImageClickEventArgs e)
    {
        string Password = objService.GetPassword(txtLogin.Text.ToString());
        if (txtPassword.Text.ToString() == Password)
        {
            Session["UserName"] = txtLogin.Text.ToString();
            Response.Redirect("Home.aspx");
        }
        else
        {
            lblMessage.Text = "User name and Password are not matched";
        }



    }
    protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
    {
        txtLogin.Text = string.Empty;
        txtPassword.Text = string.Empty;

    }
}
